<?
	include_once ("../include/conn.php");
	include_once ('config.php');

	/**************************************** 
	****************获取用户的自定久联系信息*****************
	******************************************/



	//开始数据处理
	$openid = $_GET['openid'];
	$unionid = $_GET['unionid'];

	$results = array('code' => 0,'msg'=>'数据正常！');//用于正常有数据输出的

	//////////////////////////// 取出用户信息 //////////////////////////
	// 如果没用unionid就用openid
	if($unionid){
		$cmd = "select * from {$TABLE_C}user where unionid='$unionid'";
	}else{
		$cmd = "select * from {$TABLE_C}user where openid='$openid'";
	}
	$row = $mydb->fetch_assoc($cmd);

	$results['userContactInfo'] = Array(
		'id' => $row['id'],
		'contact_name' => $row['contact_name'],
		'contact_tel' => $row['contact_tel'],
		'company' => $row['company']
	);


	// //////////////////输出数据////////////////////////////////

	echo json_encode($results);

	// 结束
	mysql_close();
?>